<%@ page import="cn.darkfire.web.POJO.User" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Set" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/10/12
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>信息展示</title>
</head>
<body>
<%
    HashMap<String,User> users = (HashMap<String, User>)application.getAttribute("hashMap");
    User user = (User)session.getAttribute("user");
    response.setHeader("Refresh", "3;URL=destory.jsp");

%>
<center>
姓名:<%=user.getName()%><br>
年龄:<%=user.getAge()%><br>
爱好:
<%
 for(String hobby:user.getHobbys()){
     if(hobby.equals("C")){
         out.print("<li>C语言</li>");
     }else if(hobby.equals("C_Plus")){
         out.print("<li>C++语言</li>");
     }else{
         out.print("<li>JAVA 语言</li>");
     }
 }
%><br>
    <a>当前导入的数据:</a><br><hr>
    <%
        for(User user1:users.values()){
            out.print("用户名:"+user1.getName()+",用户年龄:"+user1.getAge()+"," +
                    "用户爱好:"+Arrays.toString(user1.getHobbys())+"<br>");
            out.print("<hr>");
        }
    %>
<a>将在3秒后清除session并跳转到首页....</a>
</center>
</body>
</html>
